import { createRouter, createWebHashHistory } from 'vue-router'
import LoginView from '../views/index/LoginView.vue'
import Welcome from '../views/index/Welcome.vue'
import CompanyListView from '../views/company/CompanyListView.vue'
import CompanyDetail from '../views/company/CompanyDetailView.vue'
import CompanyEdit from '../views/company/CompanyEditView.vue'
import CompanyAdd from '../views/company/CompanyAddView.vue'
import StockListView from '../views/stock/StockListView.vue'
import StockIndex from '../views/stock/IndexView.vue'
import StockDetail from '../views/stock/DetailView.vue'
import FundListView from '../views/fund/FundListView.vue'
import UserList from '../views/user/UserList.vue'
import InstitutionListView from '../views/institution/InstitutionListView.vue'
import ConfView from '../views/sysconf/ConfView.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import('../views/index/IndexView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component:LoginView
    },
    {
      path: '/welcome',
      name: 'Welcome',
      component:Welcome
    },
	//-------company--------------
	{
	  path: '/company',
	  name: 'company',
	  component:CompanyListView,
	},
	{
	  path: '/company_detail/:id',
	  name: 'company_detail',
	  component:CompanyDetail,
	},
	{
	  path: '/company_edit/:id/',
	  name: 'company_edit',
	  component:CompanyEdit,
	},
	{
	  path: '/company_add',
	  name: 'company_add',
	  component:CompanyAdd,
	},
	//-------company--------------
	//-------stock--------------
    {
      path: '/stock/:id',
      name: 'stock',
      component:StockListView,
      children:[
        // {
        //   path: '/stock_detail',
        //   name: 'stock_detail',
        //   component:StockDetail
        // }
      ]
    },
	//-------stock--------------
	{
	  path: '/fund',
	  name: 'fund',
	  component:FundListView,
	  // children:[
	  //   {
	  //     // path: '/company_detail',
	  //     // name: 'company_detail',
	  //     // component:CompanyDetail
	  //   }
	  // ]
	},
	{
	  path: '/user',
	  name: 'user',
	  component:UserList,
	  // children:[
	  //   // {
	  //   //   path: '/user_detail',
	  //   //   name: 'user_detail',
	  //   //   component:StockDetail
	  //   // }
	  // ]
	},
	{
	  path: '/institution',
	  name: 'institution',
	  component:InstitutionListView,
	  // children:[
	  //   {
	  //     // path: '/company_detail',
	  //     // name: 'company_detail',
	  //     // component:CompanyDetail
	  //   }
	  // ]
	},
	{
	  path: '/sysconf',
	  name: 'sysconf',
	  component:ConfView,
	  // children:[
	  //   {
	  //     // path: '/company_detail',
	  //     // name: 'company_detail',
	  //     // component:CompanyDetail
	  //   }
	  // ]
	},
  ]
})

export default router
